home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun: Productivity Pak 1
/
rerun-productivity-pak-i.d64
/
dfreport
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
8KB
|
253 lines
500 rem-datafile 3.3 subprogram dfreport by mike konshak (c)1983
502 ifx=0thenprint" please load and run datafile[146]":end
504 open4,4:ifpw=0thenpw=80
506 gosub4000:goto614
508 rem----subprograms
510 print"[147] loading main program"
512 load"datafile",8
514 print"[147] loading mailing label subprogram"
516 load" dfmail",8
518 rem----quit routine
520 print"[147]quiting now will erase current data"
522 print"are you sure you want to quit?":print" y[146] or n[146] ?
524 [161]a$:[139]a$[178]"" [167]524
526 [139]a$[178]"n"[167]614
528 [139]a$[178]"y"[167]532
530 [137]524
532 [160]4:[153]"loadsubprogram terminated"
534 [153]"datafilewait by mike konshak (c)1983":[128]
536 [143]----search
538 a0[178]0:[153]"load print options menu "
540 [153]" awaitll records in file
542 print" s[146]elect individual records
544 [153]" fwaitind records with common fields
546 print" e[146]xit to main menu
548 [153]"position paper in printer at top of page"
550 [153]"printer may stop during printing if the"
552 [153]"computer needs to reallocate memory."
554 [153]" press the appropriate key "
556 [161]c$:[139]c$[178]"" [167]556
558 [139]c$[178]"a"[167]606
560 [139]c$[178]"s"[167]fl[178]0:[137]570
562 [139]c$[178]"f"[167]580
564 [139]c$[178]"e"[167]614
566 [137]556
568 [143]----select record
570 [133]"loadprint which record (0wait to exit)";i$:i[178][197](i$):[139]i[178]0[167]890
572 [139]i[177]x[167][153]"no such record exists!ononon":[129]s[178]1[164]1000:[130]s:[137]570
574 [139]k[178]2[175]fl[178]0[167][141]810:[141]824:[141]842:[141]888:fl[178]1:[137]570
575 [139]k[178]2[175]fl[178]1[167][141]842:[141]888:[137]570
576 [141]798:[141]4034:[137]538
578 [143]----search
580 [153]"load find records with common items "
582 [129] n[178]1[164]f:[153]" ";n;"wait ";f$(n):[130]n
584 [133]"which field is to be searched";sf
586 [139]sf[179]0[176]sf[177]f[167][153]"ononon":[137]584
588 [153]"enter common itemwait ":[153]"(the entire string is not required)"
590 [153]"";f$(sf);"wait ";:[133]t$
592 [139]k[178]2[167][141]810:[141]824
594 [129]i[178]1[164]x
596 [153]"searching record";i;"onon"
598 [139]t$[178][200](rec$(k%(i),sf),[195](t$))[167][145]k[141]798,842:[141]888
600 [130]i
602 [137]890
604 [143]----print all
606 [133]"load start at record? 1cmdcmdcmd";s:[139]s[177]x[176]s[179]1[167]606
607 [153]"load printing heading":[139]k[178]2[167][141]810:[141]824
608 [129]i[178]s[164]x:[153]"on printing record #";i:[145]k[141]798,842:[141]888:[130]i
610 [137]890
612 [143]----print records menu
614 [153]"load report printout menu "
616 [153]" lwaitist records unformatted"
618 [153]" pwaitre-defined format or"
620 [153]" dwaitefine new format"
621 [153]" cwaitonfigure printer"
622 [153]" ewaitxit to main program or"
624 [153]" mwaitailing label program"
626 [153]" qwaituit program"
628 [153]" press the appropriate key "
630 [161]c$:[139]c$[178]"" [167]630
632 [139]c$[178]"l"[167]k[178]1:[137]538
633 [139]c$[178]"c"[167][141]4000:[137]614
634 [139]c$[178]"p"[167]k[178]2:[137]766
636 [139]c$[178]"e"[167][160]4:[137]510
638 [139]c$[178]"m"[167][160]4:[137]514
640 [139]c$[178]"d"[167]k[178]2:[137]646
642 [139]c$[178]"q"[167]520
644 [137]630
646 [153]"loadreport sizewait up to 136 character wide."
648 [153]"printer must be initialized for widths"
650 [153]"greater than 80 characters. check your"
652 [153]"printer manual to how to print 136 chrs"
654 [153]"number of characters?":[153]"? cmdcmdcmd";pw:[133]"on";pw
656 [139]pw[177]136[167]654
658 [153]"loadtitle formatwait up to 4 title lines of"
660 [153]"information at the top of the form."
662 [153]"number of lines?":[153]"? cmdcmdcmd";nl:[133]"on";nl:[139]nl[177]4[167]662
664 [129]j[178]1[164]nl:[153]"title #";j:[153]"? > cmdcmdcmd";tt$(j)
666 [139][195](tt$(j))[177]37[167][153]"on";
668 [133]"on";tt$(j):[139]tt$(j)[178]""[167]tt$(j)[178]">"
670 [130]j
672 [153]"loadcolumn formatwait up to 8 columns with 2":[153]"spaces between columns"
674 [153]"number of columns?":[153]"? cmdcmdcmd";nc:[133]"on";nc:[139]nc[177]8[167]674
676 [129]j[178]1[164]nc:[153]"position of column #";j:[153]"? cmdcmdcmd";pc(j)
678 [133]"on";pc(j):[130]j
680 [153]"loadheading formatwait column headings cannot"
682 [153]"exceed width of columns:"
684 [129]j[178]1[164]nc:[153]"column";j;" heading";
686 [139]j[178]nc[167][153]80[171]pc(j);:[137]690
688 [153]pc(j[170]1)[171]2[171]pc(j);
690 [153]" characters wide"
692 [153]"? > cmdcmdcmd";hc$(j):[133]"on";hc$(j):[139]hc$(j)[178]""[167]hc$(j)[178]">"
694 [130]j
696 [153]"loadchoose which fields go under the columns"
698 [153]"enter 0wait if additional fields are":[153]"not desired."
700 [129]n[178]1[164]f:[153]"";n;"wait ";f$(n):[130]n
702 [129]j[178]1[164]nc:[153]"";[163]25)"column";j;""
704 [129]l[178]1[164]3:[153][163]25)"onfield";l;" 0 cmdcmd";ml$(j,l)
706 [153][163]32);"on";:[133]ml$(j,l):[130]l:[130]j
708 [153]"loaddo you wish to sum the data in column"[170][196](nc)[170]"?"
709 [153]"this column must only be formatted with"
710 [153]"only one field. enter 1wait (yes) or 0wait (n0)"
711 [153]"?";z:[133]"on";z
712 [153]"loaddo you wish to review your format and/or"
714 [153]"make corrections? press ywait or nwait"
716 [161]a$:[139]a$[178]""[167]716
718 [139]a$[178]"y"[167]646
720 [139]a$[178]"n"[167]726
722 [137]716
724 [143]----save format
726 [153]" save formatwait? ywait or nwait"
728 [161]a$:[139]a$[178]""[167]728
730 [139]a$[178]"n"[167]538
732 [139]a$[178]"y"[167]736
734 [137]728
736 [153]"save under what file name?"
738 [153]" ";nf$:[133]"on";nf$:[139]nf$[178]""[167]614
740 [159]15,8,15:[152]15,"s0:rp] "[170]nf$:[141]876:[139]et[178]8[167]614
742 [159]5,8,5,"0:rp] "[170]nf$[170]",s,w":[141]876:[139]et[178]8[167]614
744 [152]5,pw;cr$;nl;cr$;nc:[141]876:[139]et[178]8[167]614
746 [129]j[178]1[164]nl
748 [152]5,tt$(j):[141]876:[139]et[178]8[167]614
750 [130]j
752 [129]i[178]1[164]nc
754 [152]5,pc(i);cr$;hc$(i):[141]876:[139]et[178]8[167]614
756 [129]n[178]1[164]3
758 [152]5,ml$(i,n):[141]876:[139]et[178]8[167]614
760 [130]n:[130]i:[152]5,[196](z);cr$;e$:[141]876:[139]et[178]8[167]614
762 [160]5:[160]15:[137]538
764 [143]----load format
766 [153]"load format from what file?"
768 [153]" ";nf$:[133]"on";nf$:[139]nf$[178]""[167]614
770 [159]15,8,15:[159]5,8,5,"0:rp] "[170]nf$[170]",s,r":[141]876:[139]et[178]8[167]614
771 [139]en[178]62[167][141]878:[137]614
772 [132]5,pw,nl,nc:[141]876:[139]et[178]8[167]614
774 [129]j[178]1[164]nl
776 [132]5,tt$(j):[141]876:[139]et[178]8[167]614
778 [130]j
780 [129]i[178]1[164]nc
782 [132]5,pc(i),hc$(i):[141]876:[139]et[178]8[167]614
784 [129]n[178]1[164]3
786 [132]5,ml$(i,n):[141]876:[139]et[178]8[167]614
788 [130]n:[130]i:[132]5,a1$:z[178][197](a1$)
790 s[178]st:[139]s[179][177]0[167]794
792 [132]5,e$
794 [160]5:[160]15:[137]712
796 [143]----print nonformatted listing
798 [152]4,"[ record #";i;" ]";:[129]j[178]1[164]62:[152]4,"-";:[130]j:[141]4034
800 [129]n[178]1[164]f
802 [152]4,f$(n);:[129]j[178]1[164]20[171][195](f$(n)):[152]4,".";:[130]j
804 [152]4,rec$(k%(i),n)
806 [130]n:[141]4034:[142]
808 [143]----print report
810 pg[178]0:s$[178]"":[129]j[178]1[164]pw:s$[178]s$[170]b$:[130]j
812 [129]j[178]1[164]nl:[139]tt$(j)[179][177]">"[167][141]818
814 [130]j:[142]
816 [143]----center title
818 b[178][181]((pw[171][195](tt$(j)))[173]2):[139]p[179][177]1[167]821
820 [152]4,[200](s$,b)[170]tt$(j);b1$;:pg[178]pg[170]1:[142]
821 [152]4,[200](s$,b)[170]tt$(j);b1$:pg[178]pg[170]1:[142]
822 [143]----position headings
824 [141]838:pc(nc[170]1)[178]pw[170]3:cw[178]pc(2)[171]2[171]pc(1):[139]pc(1)[177]1[167]828
826 [152]4,[200](hc$(1),cw);:[137]830
828 [152]4,[200](s$,pc(1)[171]1)[170][200](hc$(1),cw);
830 [129]j[178]2[164]nc:m[178]pc(j)[171][195]([200](hc$(j[171]1),pc(j)[171]2[171]pc(j[171]1)))[171]pc(j[171]1)
832 [152]4,[200](s$,m)[170][200](hc$(j),pc(j[170]1)[171]2[171]pc(j));
834 [130]j:[141]4034:[141]838:pg[178]pg[170]3:[142]
836 [143]----print dashed line
838 [129]j[178]1[164]pw:[152]4,"-";:[130]j:[141]4034:[142]
840 [143]----print file data
842